#include "GameOverState.h"
#include "MainMenuState.h"
#include <sstream>

GameOverState::GameOverState(const std::string& winner)
    : MenuState("Game Over"), winner(winner)
{
}

GameOverState::~GameOverState()
{
}

GameState* GameOverState::performMenuAction1()
{
    return goToNextState(new MainMenuState());
}

GameState* GameOverState::performMenuActionEscape()
{
    return goToNextState(new MainMenuState());
}

void GameOverState::addWinner()
{
    std::ostringstream oss;
    oss << "Winner: " << winner << "!";
    addLine(oss.str());
}

void GameOverState::addMenuLines()
{
    addWinner();
    addLine("");
    addLine("1 or ESC. Go to Main Menu");
}
